package com.example.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.pojo.Competition;
import com.example.demo.pojo.vo.Count;
import com.example.demo.result.Result;
import com.example.demo.service.CountService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mysql.jdbc.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/count")
public class CountController {
    @Autowired
    private CountService countService;
    @PostMapping("listCount/{current}/{limit}")
    public Result getCountList(@PathVariable Integer current, @PathVariable Integer limit, @RequestBody(required = false) Count count){
        PageHelper.startPage(current,limit);
        PageInfo<Count> countPageInfo = countService.listCount(count);
        return Result.success(countPageInfo);
    }
}
